package bitbot.md.bitstamp;

import java.util.ArrayList;
import java.util.List;

import bitbot.md.PairExchangeData;
import bitbot.md.TimeAndSales;
import bitbot.md.TimeAndSales.TimeAndSalesRec;

public class BitstampTimeAndSalesData {
	
	private final BitstampTimeAndSale[] m_tos;
	private final long m_timestamp;
	
	public BitstampTimeAndSale[] getTos() { return m_tos;}

	public long getTimestamp()   { return m_timestamp; }

    public BitstampTimeAndSalesData(BitstampTimeAndSale[] tos, long l) {
		m_tos = tos;
		m_timestamp = l;
	}
    
    public TimeAndSales convert(PairExchangeData c){
    	List<TimeAndSalesRec> recs = new ArrayList<TimeAndSalesRec>(m_tos.length);
    	for (BitstampTimeAndSale rec : m_tos) {
			recs.add(rec.convert());
		}
    	
    	return  new TimeAndSales(c, m_timestamp, recs);
    }
	
}
